import { Badge, Tag, Tooltip } from '@douyinfe/semi-ui';
import { ColumnProps } from '@douyinfe/semi-ui/lib/es/table';
import { CoordinationStatus } from '../helper';

const BaseColumns: ColumnProps[] = [
  {
    title: '标题',
    dataIndex: 'title',
    render: (cellContent: any) => {
      return <span className='font-bold'>{cellContent}</span>;
    },
  },
  {
    title: '情况描述',
    dataIndex: 'content',
    render: (cellContent: any) => {
      return (
        <Tooltip
          content={<span className='text-sm'>{cellContent}</span>}
          arrowPointAtCenter={false}
        >
          <p className='text-slate-500 truncate' style={{ width: '200px' }}>
            {cellContent}
          </p>
        </Tooltip>
      );
    },
  },
  {
    title: '发起方',
    dataIndex: 'createUserVo.name',
    width: 100,
  },
  {
    title: '发起方企业',
    dataIndex: 'createUserVo.corporation',
    width: 250,
  },
  {
    title: '接收方',
    dataIndex: 'acceptUserVo.name',
    width: 100,
  },
  {
    title: '接收方企业',
    dataIndex: 'acceptUserVo.corporation',
    width: 250,
  },
  {
    title: '状态',
    dataIndex: 'opportunityStatus',
    render: (cellContent: any) => {
      return (
        <span>
          <Badge
            dot
            // @ts-ignore
            type={CoordinationStatus[cellContent]?.color}
            className='mr-1'
          />
          {/* @ts-ignore */}
          {CoordinationStatus[cellContent]?.text}
        </span>
      );
    },
  },
];

export default BaseColumns;
